<template>
	<uni-popup ref="gzStatus" type="bottom">
		<view class="popop">
			<view class="header">
				<view class=""></view>
				<image :src="iconurl + '/static/user/pop_d.png'" @click="backpop"></image>
			</view>
			<view class="section">选择收货地址</view>
			<view class="section_cont">
				<view class="sec_left"><image :src="sendOrderList.prize_list.prize_icon"></image></view>
				<view class="sec_right">
					<view class="navname">{{ sendOrderList.prize_list.prize_name }}</view>
					<!-- <view class="price">一发入魂</view> -->
					<view class="number flex-c-c">{{prize_level}}</view>
				</view>
			</view>
			<view class="local_box">
				<view class="" v-if="address">
					<view class="local-two">
						<image :src="iconurl + '/static/user/dingwei.png'"></image>
						<view class="middle">
							<view class="info-box">
								<view class="name">{{ sendOrderList.address.name }}</view>
								<view class="tel">{{ sendOrderList.address.mobile }}</view>
							</view>
							<view class="local">{{ sendOrderList.address.province }}{{ sendOrderList.address.city }}{{ sendOrderList.address.district }}{{ sendOrderList.address.detail }}</view>
						</view>
						<view class="change" @click="changeLocal">更改</view>
					</view>
				</view>
				<!-- <view class="local-one" v-else @click="addLocal">
					<view class="">您还没有收货地址，去添加收货地址~</view>
					<u-icon name="arrow-right"></u-icon>
				</view> -->
			</view>
			<view class="foot" @click="fahuo">确定</view>
		</view>
	</uni-popup>
</template>

<script>
// import jisuan from "@/common/toCalculate.js"
// ////console.log(jisuan.add(0.1,0.65))
export default {
	props: {
		sendOrderList: {
			type: Object,
			default() {
				return [];
			}
		},
		money: {
			type: Number,
			default() {
				return [];
			}
		},
		prize_level: {
			type: String,
			default() {
				return [];
			}
		},
	},
	data() {
		return {
			check: 1,
			current: 0,
			price: '',
			coupons: '',
			id: '',
			address: {},
			address_id: null,
			iconurl:this.$configs.urls
		};
	},
	created() {},
	watch: {},
	methods: {
		changeLocal() {
			uni.navigateTo({
				url: '/userPage/user/address/address'
			});
		},
		animationfinish(e) {
			if (e.detail.current == 1) {
				this.$emit('getCoupon');
			}
		},
		open() {
			this.$refs.gzStatus.open();
		},
		//选中优惠券
		choice(index, item) {
			this.price = item.sub_price;
			this.coupons = item.name;
		},
		//切换支付方式
		checks(num) {
			this.check = num;
		},
		//关闭弹窗
		backpop() {
			this.$refs.gzStatus.close();
		},
		//使用优惠券
		detail() {
			this.current = 1;
			this.$emit('getCoupon');
		},
		//返回箭头
		fan() {
			this.current = 0;
		},
		//确认支付
		fahuo() {
			this.$emit('goFahuo');
		}
	}
};
</script>

<style lang="scss" scoped>
	.local_box {
		width: 710rpx;
		margin: 0 auto;
		border-radius: 20rpx;
		.local-one {
			width: 100%;
			height: 160rpx;
			background-color: white;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 20rpx;
			font-size: 32rpx;
			color: #666666;
			margin-bottom: 20rpx;
	
			image {
				width: 30rpx;
				height: 39rpx;
			}
		}
	
		.local-two {
			width: 100%;
			height: 160rpx;
			background-color: white;
			display: flex;
			align-items: center;
			padding: 0 20rpx;
			margin-bottom: 20rpx;
	
			image {
				width: 45rpx;
				height: 55rpx;
				margin-right: 30rpx;
			}
	
			.middle {
				width: 70%;
				display: flex;
				flex-direction: column;
				height: 90%;
				justify-content: space-around;
	
				.info-box {
					display: flex;
					align-items: center;
	
					.name {
						font-weight: 600;
						font-size: 32rpx;
						margin-right: 25rpx;
					}
				}
	
				.local {
					font-size: 30rpx;
					width: 100%;
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;
				}
			}
	
			.change {
				height: 100%;
				display: flex;
				align-items: center;
				margin-left: 50rpx;
				color: #666666;
				font-size: 30rpx;
			}
		}
	}
.section_cont {
	width: 690rpx;
	margin: 20rpx auto;
	border-radius: 10rpx;
	display: flex;
	align-items: center;
	position: relative;
	.right_top {
		width: 100rpx;
		height: 50rpx;
		background: #ff5123;
		font-size: 24rpx;
		color: #333;
		position: absolute;
		right: 20rpx;
		top: 20rpx;
		border-radius: 20rpx;
	}
	.right_bom {
		display: flex;
		align-items: center;
		position: absolute;
		right: 20rpx;
		bottom: 20rpx;
		image {
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;
		}
		text {
			font-size: 24rpx;
			color: #333;
		}
	}
	.sec_left {
		image {
			width: 240rpx;
			height: 214rpx;
			border-radius: 8rpx;
		}
	}
	.sec_right {
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		height: 180rpx;
		margin-left: 30rpx;
		.navname {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			font-weight: 700;
			word-break: break-all;
			text-overflow: ellipsis;
			overflow: hidden;
			display: -webkit-box;
			-webkit-line-clamp: 1;
			-webkit-box-orient: vertical;
		}
		.name {
			font-size: 26rpx;
			font-family: PingFang SC;
			color: #666666;
			word-break: break-all;
			text-overflow: ellipsis;
			overflow: hidden;
			display: -webkit-box;
			-webkit-line-clamp: 1;
			-webkit-box-orient: vertical;
		}
		.number {
			width: 140rpx;
			height: 46rpx;
			background: linear-gradient(90deg, #9797F7 0%, #7E76ED 100%);
			border-radius: 10rpx;
			color: #FFFFFF;
			
		}
	}
}
.shere {
	width: 40rpx;
	height: 40rpx;
	margin-right: 20rpx;
}
.section {
	font-size: 50rpx;
	color: #333333;
	font-weight: bold;
	display: flex;
	justify-content: center;
	align-items: center;
}
.block {
	background-repeat: no-repeat;
	background-size: 100% 100%;
	width: 90%;
	height: 200rpx;
	margin: 0 auto;
	margin-top: 20upx;
	display: flex;
	align-items: center;
	position: relative;
	.left {
		padding: 15rpx 0;
		width: 190rpx;
		.sub_price {
			color: #fff;
			font-size: 70rpx;
			text-align: center;
		}
		.txt {
			font-size: 26rpx;
			line-height: 37rpx;
			padding-top: 5rpx;
			color: #fff;
			text-align: center;
		}
		.txts {
			padding-top: 40upx;
		}
		.btns {
			width: 140rpx;
			height: 51rpx;
			line-height: 47rpx;
			background: #ffffff;
			border-radius: 28rpx;
			text-align: center;
			margin-right: 20upx;
			color: #ff6505;
			margin-left: 30upx;
			margin-top: 15upx;
		}
	}
	.right {
		flex: 1;
		padding-left: 60rpx;
		padding-bottom: 30rpx;
		.types {
			font-size: 24upx;
			width: 115upx;
			height: 35upx;
			border-radius: 35upx;
			line-height: 32upx;
			text-align: center;
			background: #ff6505;
			color: #ffffff;
			margin-right: 10upx;
		}
		.info {
			flex: 1;
		}
		.min_price_desc {
			font-size: 40rpx;
			line-height: 48rpx;
			color: #333;
			padding: 30upx 0;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			.name {
				width: 320upx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}
		.time {
			color: #666;
			font-size: 24rpx;
		}
		.times {
			margin: 15upx 0;
		}
		.imgs {
			image {
				width: 109upx;
				height: 70upx;
				margin-right: 20upx;
			}
		}
		.flexs2 {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 7upx;
			.flexs1 {
				display: flex;
				justify-content: flex-start;
				align-items: center;
				color: #999999;
				font-size: 24upx;
				.img {
					width: 28upx !important;
					height: 28upx !important;
					margin-left: 10upx;
				}
			}
			.btn {
				width: 140rpx;
				height: 51rpx;
				line-height: 47rpx;
				border: 1rpx solid #ff6505;
				border-radius: 28rpx;
				text-align: center;
				margin-right: 20upx;
				color: #ff6505;
			}
		}
	}
}
.popop {
	width: 100vw;
	min-height: 720rpx;
	background: #ffffff;
	border-top-left-radius: 20rpx;
	border-top-right-radius: 20rpx;
	.header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-top: 20rpx;
		padding-right: 20rpx;
		image {
			width: 40rpx;
			height: 40rpx;
		}
	}
	.section3 {
		padding: 20rpx;
		.title {
			font-size: 34rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #333333;
		}
		.sec {
			display: flex;
			align-items: center;
			padding-top: 20rpx;
			image {
				width: 44rpx;
				height: 44rpx;
			}
			text {
				padding-left: 30rpx;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
			}
		}
	}
	.foot {
		width: 710rpx;
		height: 88rpx;
		margin: 0 auto;
		margin-top: 40rpx;
		margin-bottom: 20rpx;
		background: #817bee;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #ffffff;
		font-size: 30rpx;
		border-radius: 100rpx;
	}
}
.cons {
	height: 450upx;
	overflow-y: scroll;
}
</style>
